#1 导入依赖
import json
import urllib.request

#2 发送请求
response=urllib.request.urlopen("https://game.gtimg.cn/images/lol/act/img/js/heroList/hero_list.js?ts=2880900")

#3 分析响应的结果
hero_json = json.loads(response.read())
# print(hero_json)
# print(type(hero_json))
# <class 'dict'>
hero_list = hero_json['hero']
# print(type(hero_list)) # <class 'list'>
print(hero_list)
for hero in hero_list:
    print(hero['heroId'])
    print(hero['name'])
    print(hero['alias'])
    print(hero['title'])
